<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TPD mobile - Website bán điện thoại di động</title>
<link rel="stylesheet" type="text/css" href="CSS/Style.css">
</head>
<body background="index/bg.jpg">
<script language=javascript >

title_tmp1=document.title
if (title_tmp1.indexOf(">>")!=-1){
title_tmp2=title_tmp1.split(">>");
title_last="*~*"+title_tmp2[1];
title_last=title_last + "*~*" + title_tmp2[2];
}else{

if (title_tmp1.indexOf("*~*")!=-1){
title_tmp2=title_tmp1.split("*~*");
title_last="*~*"+title_tmp2[1];
if (title_last=="*~*"){title_last="*~*"};
if (title_last=="*~*"){title_last="*~*"};
}
else { title_last=" -- TPD mobile -- "}
}


title_new=""+title_last+""
step=0

function flash_title()
{
step++
if (step==8) {step=1}
if (step==1) {document.title='[----*'+title_new+'*----]'}
if (step==2) {document.title='[---*-'+title_new+'-*---]'}
if (step==3) {document.title='[--*--'+title_new+'--*--]'}
if (step==4) {document.title='[-*---'+title_new+'---*-]'}
if (step==5) {document.title='[--*--'+title_new+'--*--]'}
if (step==6) {document.title='[---*-'+title_new+'-*---]'}
if (step==7) {document.title='[----*'+title_new+'*----]'}
setTimeout("flash_title()",180);
}
flash_title()

</script>

<div id="divContainer">
  <div id="divHeader">
			<div id="divBanner">
			<embed src="flash/banner.swf" quality="high" type="application/x-shockwave-flash" wmode="transparent" width="1024" height="220" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always"></embed>
			</div>
			<div id="divMenu">
	<ul>
			<li><a href="http://localhost/WebDTDD/" class="active" title="Trang chủ"><b>Trang Chủ</b></a></li>
            <li><a href="http://localhost/WebDTDD/gioithieu.php" title="Giới thiệu"><b>Giới thiệu</b></a></li>
            <li><a href="http://localhost/WebDTDD/sanpham.php" title="Sản phẩm"><b>Sản Phẩm</b></a></li>
			<li><a href="http://localhost/WebDTDD/dichvu.php" title="Dịch vụ"><b>Dịch vụ</b></a></li>
            <li><a href="http://localhost/WebDTDD/bando.php" title="Bản đồ"><b>Bản đồ</b></a></li> 
            <li><a href="http://localhost/WebDTDD/lienhe.php" title="Liên hệ"><b>Liên hệ</b></a></li>
					
			<span style="float: right; padding-left:50px; padding-bottom: 7px;">
			<input type="text" name="txtWord" />
			<input type="submit" value="Tìm kiếm" name="btnSearch" />
			<img src="index/shopping_cart.png" width="25" height="25" style='vertical-align: auto'>
            <?php
			 $ok=1;
				if(isset($_SESSION['DT']))
				{
				foreach($_SESSION['DT'] as $k=>$v)
				  {
					   if(isset($v))
					   {
					   $ok=2;
					   }
				  }
				}
				 if ($ok != 2)
				  {
				  echo '<font size="2" color="#CCFF00" >0</font>';
				  } else 
					{
					  $items = $_SESSION['DT'];
					  echo '<font size="2" color="#CCFF00" ><a href="DT.php">'.count($items).'</a></font>';
					}
			?>
			</span>
						      
  </ul>
  
    </div>
  </div>
			
		<div class="clr"></div>
		
		
		
  <div id="divLeft">
                <img src ="./DT/left.jpg"></br>
                
                
  </div>
    <div id="divRight">
     <a href="http://localhost/WebDTDD/login.php">Đăng nhập</a>
    </div>
        <div id = "divMid">

        <center>
          <embed src ="flash/myfile.swf" width ="595" height ="336">          
        </center><br/>
        
        <table width="100%" border="1" align="center"  >
        <tr align="center">
        <td colspan="3">
        <h3><center>
          <p>&nbsp;</p>
          <font size="+2" color="black"><p>Điện Thoại</p></font>
          <p>&nbsp;</p>
        </center></h3>
        </td>
        </tr>
        <tr align="center">
         <?php
		 $x = 0;
        // put your code here
        mysql_connect("localhost","root","") or die ("ket noi khong thanh cong") ;
		 mysql_select_db("DTDD")or die ("khong tim thay csdl");
		$DT = mysql_query("select * from sanpham ");
		while ($row = mysql_fetch_array($DT))
		{
			$x+=1;
		?>
        <td>
		  <p>
		    <?php echo "<label><strong><u><p><a href='addDT.php?item=$row[0]'> $row[2] </strong></label></a></p></u>";?>
	      </p>
		  <p><br/>
	      <img src ="<?php echo $row[5];?>" width ="114" height ="163"></p>
		  <p><br/>
		    <font color="#FFFFFF"><label><strong>Giá : <?php echo "". number_format($row[4],3) ." VND";?>
	        </strong></label></font><br>
             <?php echo "<form action='#' method ='post'>" ?>
            <input align="left" type="submit" name="btn_ChiTiet" value="Chi Tiết" id="btn_ChiTiet">
            </form> 
             <?php echo "<form action='addDT.php?item=$row[0]' method ='post'>" ?>
            
		    <input name="btn_MuaHang" type="submit" id="btn_MuaHang" value="Mua Hàng">
			</form>
		  </p>
          <br>
		 </td>
		 <?php
		 if($x ==3)
		 {
			 $x = 0;
			 ?>
             </tr>
			 <tr align="center">
         <?php
        }
	
		}  ?>
        </table> 
  </div>
		<div class="clr"></div>
		<div id="divFooter">Footer
		</div>
</div>
</body>
</html>